import axios from 'axios';
import url from "./url"
// 创建axios实例
axios.defaults.baseURL=url.axiosUrl
const service = axios.create({
  timeout: 5000 // 请求超时时间
});
// request拦截器
service.interceptors.request.use(config => {
    
  return config;
}, error => {
  Promise.reject(error);
})

// respone拦截器
service.interceptors.response.use(
  response => {
      return response.data;
  },
  error => {
    return Promise.reject(error);
  }
);

export default service;